package com.chinamsp.annotation;

import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import org.springframework.core.annotation.AliasFor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * mix rest controller 注解，整合了 {@link MixRestController} 和 {@link RequestMapping} 注解
 * @author shifenghu
 *
 */
@Documented
@Retention(RUNTIME)
@Target(TYPE)
@RestController
@RequestMapping
public @interface MixRestController {

	/**
	 * 路径
	 * @return
	 */
	@AliasFor(annotation = RequestMapping.class, attribute = "path")
	String[] value() default {};
	
	/**
	 * testbean 名称
	 * @return
	 */
	@AliasFor(annotation = RequestMapping.class)
	String name() default "";
	
	/**
	 * 路径
	 * @return
	 */
	@AliasFor(annotation = RequestMapping.class)
	String[] path() default {};
	
	
	/**
	 * 支持的 请求 方法
	 * @return
	 */
	@AliasFor(annotation = RequestMapping.class)
	RequestMethod[] method() default {};
	
	
	/**
	 * 请求 header
	 * @return
	 */
	@AliasFor(annotation = RequestMapping.class)
	String[] headers() default {};
	
	
	/**
	 * 支持的消费模式
	 * @return
	 */
	@AliasFor(annotation = RequestMapping.class)
	String[] consumes() default {};

	
	/**
	 * produces，默认是 json 数据格式
	 * @return
	 */
	@AliasFor(annotation = RequestMapping.class)
	String[] produces() default {"application/json; charset=UTF-8"};
	
	/**
	 * {@link RequestMapping#params()}
	 * @return
	 */
	@AliasFor(annotation = RequestMapping.class)
	String[] params() default {};
}
